This invention relates to the interpolation of greyscale levels andxe2x80x94in the most important examplexe2x80x94to the interpolation of greyscale levels in dot-based printing techniques such as ink jet printing.
It is well known that in a printing technology which is capable of producing only a single dot size, greyscale images can be created by the appropriate spatial distribution of fixed size dots. In one well known technique, pixels are organised into square arrays with each pixel in the array being assigned a different threshold value. Typically, an eight by eight square array of pixels will provide sixty-four threshold values. This square array of sixty-four threshold values is tessellated across the whole picture. At each pixel, the local grey level is compared to the threshold value assigned to that element in the pixel array and a dot is created only if the local grey level is darker than the threshold value. In the case of colour printing, this operation is of course conducted separately for each of three colours and, usually, black.
This dither technique is simple to implement and fast to run. However, great difficulties are encountered in defining the threshold array in such a way as to produce acceptable results. It is found that boundaries between areas of constant grey level are accentuated by the eye""s sensitivity to the change in pattern between the two areas. As will be recognised, the threshold approach defines for each grey level a characteristic pattern and shifts between certain grey levelsxe2x80x94which may be adjacentxe2x80x94can result in pattern changes which are distracting to the eye.
Other forms of spatial distribution, such as error diffusion, have been developed in an attempt to overcome these difficulties. The basic approach of error diffusion techniques is that the xe2x80x9cerrorxe2x80x9d between the xe2x80x9cactualxe2x80x9d and xe2x80x9cprintedxe2x80x9d grey levels at one pixel is taken into consideration in the thresholding decisions of neighbouring pixels. Even with the simplification that errors are only carried forward in time, error diffusion techniques are complex to implement. They tendxe2x80x94moreoverxe2x80x94to produce characteristically noisy grey levels.
It is an object of one form of the present invention to provide an improved method of interpolating a greyscale which enables the reduction of visually disturbing artifacts without complex processing.
The present invention has the further object of providing a solution to the problems with existing threshold arrays which is fundamental in character and which does not rely simply on empirical investigation.
Accordingly, the present invention consists in one aspect in a method of interpolating a greyscale between pixel levels in a regular array of pixels, where threshold values are associated with pixels and at each pixel a selection is made between said pixel levels in accordance with a comparison between the desired grey level and the threshold value associated with that pixel, charactersed in that rows of threshold values are defined, each row having the same repeating sequence of values with the i""th value in the sequence of the form (i*p)%S where p and S are integers and the notation a%b denotes the remainder after integer division of a by b, there being a constant offset of d pixels in the phase of the repeating sequence from one row to the next.
It is recognised in the present invention that the problem of patterning can be identified with variations in horizontal and vertical spatial frequencies between greyscale levels in the two-dimensional prior art threshold arrays. The eye is extremely sensitive to the contrast between certain spatial frequencies; changes from vertical stripes to horizontal stripes are, for example, particular noticeable, as are changes from stripes to a check. The novel approach of the present invention, by first assigning the threshold values to a linear array or row, and then creating subsequent rows by repeating the sequence with a constant offset, forces the spatial frequency content of all greyscale levels towards diagonals. The phase of the repeating sequence, determined for example by reference to the location of a specified threshold value (which might conveniently be zero), thus increases by a constant number of pixels from one row to the next succeeding row. With the spatial frequency content of all greyscales patterns being similar, the boundaries between levels become much less noticeable. It is also observed that, because of the eye""s reduced sensitivity to diagonal lines, as opposed to horizontal or vertical lines, the intrinsic visibility of the patterns is reduced.
The repeating sequence of threshold values in each row will contain all values of the greyscale, say S values. In comparison with the prior art approach of square threshold arrays of side S and xe2x80x9careaxe2x80x9d S ,the approach of the invention results in xe2x80x9cunit squaresxe2x80x9d of side S and area S2. Rather surprisingly, this increase in size of the xe2x80x9cunit squarexe2x80x9d has no material disadvantages in the quality of the image. Moreover, this observation remains true for larger values of S.
In this form of the invention, the i""th value of the repeating sequence of threshold values is defined as (i*p) % S, where p is a non-zero integer. The notation a%b denotes the remainder after integer division of a by b. By way of example, the function: (i*3) % 7 will produce the series:
36251403625
Preferably, p and S are mutually prime.
This approach elegantly assigns the threshold values to the row in an even manner. It further enables control over the difference in threshold values between adjacent pixels of the row. By increasing this difference, the spatial resolution of the image is increased, in the sense that the greater is the difference in threshold between adjacent levels, the more likely is a change in input grey level to result in a change in pixel level. Thus p is preferably chosen to be close to S/2.
The constant offset of pixels in the phase of the repeating sequence from one row to the next succeeding row may be defined as d and, preferably d is not a factor of S.
The approach of defining repeating sequences in rows and then repeating rows with a constant offset can be considered also from a more symmetric viewpoint. Take a general array i,jxe2x80x94which includes the special case where i denotes the location in the row and j the number of the rowxe2x80x94and define the threshold value at each point of the array as Tij. This threshold value can then be defined as:
Tij=(i*pxe2x88x92j*q)%S
where the notation %S denotes as before the remainder after integer division by S. It can be seen that this approach produces a constant offset d between the j""th and (j+1)""th rows of d where:
q=(Sxe2x88x92dp)%S
which can be stated more simply as
q=(xe2x88x92dp)%S
Looking at the problem of spatial resolution in both directions, there is a preference for:
p≈S/2 or q =S/2
In the prior art, the various techniques of dither and the like have been viewed as ways to produce a greyscale from printing technologies which are fundamentally binary, for example ink jet print heads which in any channel either produce an ink drop or do not. Many other printing technologies are intrinsically capable of handling greyscate and accommodate pixel values of zero to N. this being the desired greyscale range. Efforts are being made, with some success, to provide this intrinsic greyscale capability in ink jet and other, once, binary technologies by providing for N different sizes of ink drop and thus N pixel values. In a typical arrangement, a minimum value for N will be 64, which is generally regarded as being the minimum number of levels which the eye can perceive without there being obvious contrast between levels. Providing this number of distinct drop sizes in a reproducible manner, is not straightforward and in many cases, especially drop-on-demand ink jet printing, may force undesirable design compromises in other areas. For example, the smallest drop may be so small as to cause errors in placement due to aerodynamic effects.
Accordingly, the present invention, has in a different aspect, the object of providing a visually acceptable greyscale with a range of pixel values g which is significantly less than N.
Thus, in a further aspect, the present invention consists in a method of interpolating n levels between each of g pixels in a regular array of i,j pixels, where n threshold values are associated with the pixels and at each pixel a selection is made between said pixel levels in accordance with a comparison between the desired grey level G and the threshold value Tij for that pixel, where Tij=(I*pxe2x88x92j*q) % n, where p and q are integers and the notation a%b denotes the remainder after integer division of a by b, thereby to produce a visually perceived grey scale having g(nxe2x88x921)+1=N levels.
In this way, embodiments of the present invention are capable of providing greyscales of perhaps 256 levels, using 8 or less pixel values orxe2x80x94in terms of ink jet printingxe2x80x948 or less distinct drop sizes. It is found that a number of ink jet printing (and indeed other printing technologies) are capable of providing this number of pixel values in a relatively straightforward manner and without compromise in other design parameters. This invention enables in this example, however, greyscale reproduction which is close in quality to that achievable with 256 true pixel values.
It has already been observed that the most important application of greyscales lies generally in colour printing. For this purpose, the thresholding technique which has been described above can be applied to each of thexe2x80x94usually four colours Cyan, Magenta, Yellow and Black. It is a well recognised effect in conventional colour printing that inappropriately chosen masks for the respective colours can lead to visually disturbing Moire effects. One straightforward way to apply the thresholding approach of the present invention to each of four colours without risk of Moire problems would be to employ the identical threshold array Tij for each colour. It is recognised within the present invention, however, that spatial resolution can be improved significantly by employing different threshold arrays for the respective colours and the present invention has in yet a further aspect, the object of providing sets of threshold arrays which are mutually distinct which avoid Moire effects or reduce them to acceptable levels.
Accordingly, the present invention consists in yet a further aspect in a method of interpolating for each of a plurality of colours a greyscale between pixel levels in a regular array of pixels, where threshold values are associated with the pixels and at each pixel a selection is made between said pixel levels in accordance with a comparison between the desired level for each colour and the threshold value for that colour at that pixel, wherein the threshold values for each of the colours are provided by defining rows of pixels, with each row having the same repeating sequence of threshold values, there being a constant offset of pixels in the phase of the repeating sequence from one row to the next succeeding row, wherein the repeating sequences associated respectively with the colours are different for each colour and wherein the constant offset is the same for each colour.
Throughout the foregoing, the threshold values have been stated as integer values with the number S being selected somewhat arbitrarily. In an application where the grey level information defining the image to be printed has N levels, the threshold values can be scaled using the scaling factor (Sxe2x88x921)/N.
In one form of the invention, the locations in the respective arrays of corresponding zero threshold values are are offset one from another and are preferably symmetrically disposed.
Suitably, the threshold value Tijc at the i""th position of the j""th row for the c""th colour, there being a constant offset of d in the phase of the repeating sequence from one row to the next succeeding row, is given by:
Tijc=(ixe2x88x92i0c)*pc+(jxe2x88x92j0c)*qc)%(mcS)
where:
qc=(mcSxe2x88x92dpc)%(McS)
where mc is an integer which is small compared to S.
Advantageously, the points (i0c, j0c) are substantially evenly spaced from a common reference.
In an important application, the present invention further consists in a method of ink jet printing utilising an ink jet printhead capable of printing pixels of two or more levels, wherein a greyscale is interpolated between said levels in accordance with any one of the preceding statements of invention.
This invention will now be further described with reference to specific examples of threshold arrays and it is convenient to look first at an example with a value of S which is small, say 7. It will be seen that using the relationship:
Ti=(i*p)%S
and the set of numbers 0 to S-1, the following sequences can be developed, chosing different values for p. Thus, p=2 generates:
T=0, 2, 4, 6, 1, 3, 5, 0, 2 . . . for increasing i.
Selecting an offset value of, for example d=3, then produces an array Tij with each row having the same repeating sequence 0, 2, 4, 6, 1, 3, 5, offset three pixels from any one row to the next, thus:
It will be observed that the columns of this array are of the form:
Tj=(j*q)%S; where q=1.
In accordance with one form of this invention, three other threshold arrays are provided (producing, in total, one for each of four colours) utilising different sequences of the same numbers, and a constant offset d=3. Including the example given above, the four sequences can be seen to be:
For convenient representation, negative values of p may be taken to the base S so that for example, p=6 may be regarded as equivalent to p=xe2x88x921, with xe2x80x9cxe2x88x921xe2x80x9d producing the number which precedes 0 in the sequence 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 . . .
Utilising the expression: Tij=(i*pxe2x88x92j*q) % S with q=dpxe2x88x92nS, where n is an integer and may be zero, the four threshold arrays can be written as
S=7
d=3
p1=1
p2=2
p3=3
p4=xe2x88x921
The after values can be re-written as
p1=p
p2=pxe2x80x2
p3=p+pxe2x80x2
p4=pxe2x88x92pxe2x80x2
where p=1 and pxe2x80x2=2.
This notation of p and pxe2x80x2 may be a more convenient way to characterize the four arrays. The corresponding q and qxe2x80x2 coefficients can be written as:
q=dpxe2x88x92nS and qxe2x80x2=dpxe2x80x2xe2x88x92nxe2x80x2S
It will be observed that these four arrays, whatever the notation chosen to depict them, have the property that the zero threshold values are coincident in all four arrays. In this way Moire effects between colours printed using these threshold arrays, are avoided or very much reduced. By way of explanation, it can be observed that all threshold values will fall within an elementary rhomboidal area of the array bounded by four zero values. In the above table of threshold values, for example, the threshold values marked * can be seen to fall within the elementary rhomboidal area of the array bounded by zero values marked by underlining xe2x80x9c0xe2x80x9d. Any Moire effect should thus be expected to be confined to the elementary area and have negligible visual effect.
An example will now be taken of much larger S. A useful, Moire-free set of four threshold arrays can be written as
S=65
d=18
p1=xe2x88x927
p2=4
p3=xe2x88x923
p4=xe2x88x9211
The latter values can again be re-written as:
p1=p
p2=pxe2x80x2
p3=p+pxe2x80x2
p4=pxe2x88x92pxe2x80x2
where p=xe2x88x927 and pxe2x80x2=4.
Sets of arrays can be regarded as determined by choices of: S;d;p and pxe2x80x2. In a further generalisation, it has been recognised that arrays in a set which is Moire-free can vary also as multiples of S. That is to say, for a constant value of d and selected values of p and pxe2x80x2, arrays in the set can be written as:
Tij=(i*pxe2x88x92j*q)%(mS)
where m is a small, integral multiplier of, for example, 1, 2 or 3.
Looking at arrays of the form: S;m;d;p and pxe2x80x2 it remains convenient to use the substitutions:
q=(dpxe2x88x92nmS)%mS and qxe2x80x2=(dpxe2x80x2xe2x88x92nxe2x80x2mS)%mS
where there applies the condition:
npxe2x80x2xe2x88x92nxe2x80x2p=1
If the requirement for arrays in the set is that zero values are coincident, it is found that the previously mentioned solutions:
p pxe2x80x2 p+pxe2x80x2 pxe2x88x92pxe2x80x2
can be viewed as special cases of:
ap+bmpxe2x80x2
where a and b are integers which may be zero. It is then possible to identify patterns whose xe2x80x9czero""sxe2x80x9d coincide at arrays of points:
aqxe2x80x2+bmqxe2x80x2, ap+bmpxe2x80x2
Such arrays limit Moire effects to the smallest common array of zero""s.
A further example of useful arrays can be written
S=29
d=xe2x88x9217
p1=2 m1=1
p2=xe2x88x925 m2=1
p3=xe2x88x923 m3=2
p4=xe2x88x927 m4=2
The latter values can again be re-written as
p1=p
p2=pxe2x80x2
p3=p+pxe2x80x2
p4=pxe2x88x92pxe2x80x2,
where p=2 and pxe2x80x2=xe2x88x925.
The requirement for arrays in a set which is Moire-free can be satisfied if the zeros in respective arrays are coincident or can be made coinicident through translation of the arrays. Indeed, there is believed to be advantage in having the zero values of the respective arrays offset one from the other by small regular amounts so that the arrays are distributed uniformly. Thus given four, initially coincident, zero values from the respective arrays at:
(0,0) (q,p) (qxe2x80x2,pxe2x80x2) ((q+qxe2x80x2),(p+pxe2x80x2)) it can be seen that the arrays can be offset, evenly one from the other by selecting xe2x80x9cnewxe2x80x9d zero value points at:
(0,0) (q/2,p/2) (qxe2x80x2/2,pxe2x80x2/2) (q+qxe2x80x2)/2,(p+pxe2x80x2)/2)
Of course, it will be necessary to select integer values close to q/2 and so on.
An alternative approach for describing the offset between the four arrays is to define for three arrays (the choice for the first array being arbitrary) offset origins i0 and j0.